{% extends 'base.html' %}

{% load static %}

{% block title %}
School
{% endblock %}

{% block css %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static 'css/school.css' %}">
{% endblock %}

{% block content %}
<div class="container">
	<div class="columns">
		<div class="column col-6 col-lg-8 col-md-10 col-sm-12 col-lg-auto col-md-auto col-sm-auto col-mx-auto">
<div id="school_list">
	<ul class="menu-horizontal">
		{% for school in schools %}
		<li class="menu-item">
			<div class="card">
				<div class="card-image">
					<img class="img-responsive" src="{{ school.shortcut.url }}">
				</div>
				<div class="card-header">
					<div class="card-title h5">{{ school.name }}</div>
					<div class="card-subtitle text-gray"><cite>{{ school.location }}</cite></div>
				</div>
				<div class="card-body">
					<p>{{ school.desc }}</p>
					<p>老师:<span class="chip">{{ school.teachers.all|length }}</span>人  学生:<span class="chip">{{ school.students.all|length }}</span>人</p>
					<p>联系人:{{ school.owner.last_name }}老师  <sup>TEL</sup>{{ school.owner.userprofile.phone }}</p>
				</div>
				<div class="card-footer">
					<a href="/school/detail?id={{ school.pk }}"><button class="btn btn-primary float-right">更多</button></a>
				</div>
			</div>
		</li>
		{% endfor %}
	</ul>
</div>
		</div>
	</div>
</div>
{% endblock %}

{% block javascript %}
<script type="text/javascript" src="{% static 'js/school.js' %}"></script>
{% endblock %}